﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Skyhook.Sprites
{
    internal static class SpriteCache
    {
        static SortedDictionary<string, SpriteObject> SpritesCache;

        static SpriteCache()
        {
            SpritesCache = new SortedDictionary<string, SpriteObject>();
        }

        public static SpriteObject GetSpriteObject(string spritename)
        {
            SpriteObject sprite;
            if (SpritesCache.TryGetValue(spritename, out sprite))
            {
                return sprite;
            }
            return null;
        }

        public static void AddSpriteObject(string spritename, SpriteObject sprite)
        {
            SpritesCache.Add(spritename, sprite);
        }
    }
}
